package com.gmail.liulijuan.Busyness;

import java.util.ArrayList;

import com.gmail.liulijuan.DB.Employee;
import com.gmail.liulijuan.DB.EmployeeDao;

public class UserList {
	public String[][] initUserList(){
		ArrayList al;
		EmployeeDao em=new EmployeeDao();
		al=em.getAllUsers();
		String[][] user=new String[al.size()][7];
		
		for (int i = 0; i < al.size(); i++) {
			user[i][0]=String.valueOf(((Employee)(al.get(i))).getID());
			user[i][1]=((Employee)(al.get(i))).getEmployeeName();
			user[i][2]=((Employee)(al.get(i))).getSex();
			user[i][3]=((Employee)(al.get(i))).getPassword();
			user[i][4]=String.valueOf(((Employee)(al.get(i))).getAge());
			user[i][5]=((Employee)(al.get(i))).getRole();
			user[i][6]=((Employee)(al.get(i))).getPhoneNumber();
		}
		return user;
	}
	public String[] initColumTitle(){
		String[] tt={"ID","Name","Sex","Password","Age","Role","PhoneNumber"};
		return tt;
			
		
	}
	
	public ArrayList getAllUsers(){
		EmployeeDao em=new EmployeeDao();
		return em.getAllUsers();
		
	}

}
